package com.shujia.flink.tf;

import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Demo01Map {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // map：传入一行返回一行
        DataStreamSource<String> socketDS = env.socketTextStream("master", 8888);

        socketDS.map(word -> word.toUpperCase(), Types.STRING).print();

        env.execute();
    }
}
